package com.sdtv.mediunfusion.mvp.model;

import com.sdtv.basemodule.mvp.IModel;
import com.sdtv.basemodule.mvp.IView;
import com.sdtv.mediunfusion.mvp.contract.MainContract;
import com.sdtv.mediunfusion.utils.Constants;

import java.util.HashMap;

import io.reactivex.Observable;

/**
 * @ProjectName: MediunFusion
 * @Package: com.sdtv.mediunfusion.mvp.model
 * @ClassName: SelectTopicListModel
 * @Description: java类作用描述
 * @Author: 小郭同学
 * @CreateDate: 2019-08-05 14:43
 * @UpdateRemark: 更新说明
 * @Version: 1.0
 */
public class SelectTopicListModel extends IModel {

    public SelectTopicListModel(IView mIView) {
        super(mIView);
    }

    /**
     * 获取我的选题列表
     *
     * @param page 页数
     * @return
     */
    public Observable getListData(int page) {
        HashMap<String, Object> map = new HashMap<>();
        map.put("pageNumber", page);
        map.put("pageSize", Constants.PAGE_SIZE);
        return addObservable(MainContract.getAppService().getSelectList(map));
    }

    /**
     * 获取选题详情
     *
     * @param topicId
     * @return
     */
    public Observable getTopicDetail(String topicId) {
        return addObservable(MainContract.getAppService().getTopicInfo(topicId));
    }


}
